@extends('layouts.app')

@section('title')
    后台-搭配管理-打印页面
@stop

@section('extcss')
    <!--ext css-->
    <style>
        
        th,td{
            text-align:center;
            line-height: 1.1;
        }
        img{
            border: none;
            border-radius:0px;
        }
        .ln_solid{
            margin:10px auto;
        }
        .table{
            margin-bottom:0px;
        }
</style>
    <!-- /ext css-->
@stop

@section('content')
    <!-- page content -->
    <div class="right_col hidden-print" role="main" style="min-height: 1037px;">
        <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3>打印页面</h3>
                </div>

                <div class="title_right">
                    &nbsp;
                </div>
            </div>

            <div class="clearfix"></div>
            <!--出货打印效果预览-->
            <div class="row">
                <div class="col-md-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>出货清单打印</h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content text-center">
                            <div class="container-fluid">
                                <div class="row">
                                    <div class="col-md-10 col-xs-10 col-md-offset-1 col-xs-offset-1">

                                    <div class="row">
                                <div class="col-md-4 col-xs-4 col-md-offset-4 col-xs-offset-5"><h4>出货清单</h4></div>
                            </div>
                                    <div class="row">
                                <div class="col-md-3"><h5>订单编号：<em>{{\Carbon\Carbon::parse($boxs->created_at)->format('YmdHis')}}</em></h5></div>
                                <div class="col-md-3"><h5>客户名称：<em>{{$boxs->name}}</em></h5></div>
                                <div class="col-md-3"><h5>出单日期：<em>{{\Carbon\Carbon::parse($boxs->created_at)->format('Y/m/d')}}</em></h5></div>
                                <div class="col-md-3"><h5>搭配顾问：<em>{{$boxs->Users->name}}</em></h5></div>
                            </div>
                                    <div class="row">
                                    <table class="table table-bordered">
                                        <thead>
                                        <tr>
                                            <th class="col-xs-1">序号</th>
                                            <th>款号</th>
                                            <th>尺码</th>
                                            <th>颜色</th>
                                            <th>备注</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <?php $index=1;?>
                                        @foreach($boxs->Assorts as $assort)
                                        <tr>
                                            <td>{{$index++}}</td>
                                            <td>{{$assort->serial}}</td>
                                            <td>{{$assort->size}}</td>
                                            <td>{{$assort->color}}</td>
                                            <td></td>
                                        </tr>
                                        @endforeach

                                        </tbody>
                                        <tfoot>
                                        <tr>
                                            <td class="col-xs-1">{{$index++}}</td>
                                            <td>TT</td>
                                            <td colspan="3"></td>
                                        </tr>
                                        <tr>
                                            <td class="col-xs-1">{{$index++}}</td>
                                            <td>拖鞋</td>
                                            <td colspan="3"></td>
                                        </tr>
                                        </tfoot>
                                    </table>
                                </div>
                                    <div class="row text-left">
                                <div class="col-md-4"><h5>快递单号（寄）: <em>{{$boxs->express_out_no}}</em> </h5></div>
                                <div class="col-md-4"><h5>快递单号（回）: <em>{{$boxs->express_in_no}}</em> </h5></div>
                            </div>
                                    <div class="row text-left">
                                <div class="col-md-12">
                                <h5>备注：本清单有搭配顾问出单，一式两份，一份交由仓库拣货，一份搭配顾问留底。</h5>
                                </div>
                            </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="ln_solid"></div>
                        <div class="right">
                            <button type="button" class="btn btn-default pull-right btn-print" data-toggle="modal" data-target=".bs-example-modal-lg">出货清单打印</button>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <!--/出货打印效果预览-->
            <!--盒子清单打印效果预览-->
            <div class="row">
                <div class="col-md-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>盒子清单打印</h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content text-center">
                            <div class="container-fluid">
                                <div class="row">
                                    <div class="col-md-12 col-xs-12" style="border: 2px solid black;">

                                        <div class="row">&nbsp;</div>

                                        <div class="row">

                                            <div class="col-md-10 col-xs-10 col-md-offset-1 col-xs-offset-1">

                                                <!--标题-->
                                                <div class="row">
                                                    <div class="col-md-4 col-xs-6 col-md-offset-4 col-xs-offset-3 text-center">
                                                    <img src="{{asset('images/printlogo.png')}}" class="img-responsive img-thumbnail" alt="" style="border:none;width:35%;">
                                                        <h4><strong>{{$boxs->name}}的盒子清单</strong></h4>
                                                    </div>
                                                </div>
                                                <!--/标题-->
                                                <!--表格-->
                                                <div class="row">
                                                    <table class="table ">
                                                        <thead>
                                                        <tr>
                                                            <td colspan="5"></td>
                                                        </tr>
                                                        <tr>
                                                            <th>序号</th>
                                                            <th>服饰类型</th>
                                                            <th>尺码</th>
                                                            <th>单价</th>
                                                            <th>折扣价</th>
                                                        </tr>
                                                        </thead>
                                                        <tbody>
                                                        <?php $index=1 ?>
                                                        @foreach($boxs->Assorts as $assort)
                                                        <tr>
                                                            <td>{{$index++}}</td>
                                                            <td>{{$assort->color.$assort->style.$assort->Goods->category->key}}</td>
                                                            <td>{{$assort->size}}</td>
                                                            <td>
                                                                {{$assort->price}}
                                                            </td>
                                                            <td>
                                                                {{$assort->discount}}
                                                            </td>
                                                        </tr>
                                                        @endforeach
                                                        </tbody>
                                                        <tfoot>
                                                        <tr>
                                                            <td class="col-xs-2">{{$index++}}</td>
                                                            <td>TT</td>
                                                            <td colspan="3"></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="col-xs-2">{{$index++}}</td>
                                                            <td>拖鞋</td>
                                                            <td colspan="3"></td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="5"></td>
                                                        </tr>
                                                        </tfoot>
                                                    </table>
                                                </div>
                                                <!--/表格-->
                                                <!--提示-->
                                                <div class="row text-left">
                                                    <h5>温馨提示：</h5>
                                                    <h6>1、对照每件衣服上的“佐衣”吊牌编号和以上清单，可以了解每件单品的品牌名称，尺码和价格；</h6>
                                                    <h6>2、你有5天的时间试穿并决定留下哪些服饰，但如果由于试穿不当（例如污损或洗涤服饰、拆卸吊牌等）影响到服饰二次销售，“佐衣将视为你已购买此服饰而不接受退货哦。”</h6>
                                                    <h6>3、如需退回服饰，请联系当地天天快递，邮费我们会以红包的方式支付给您，请勿到付，谢谢！（天天快递官方电话：4001888888）回寄地址：长沙市天心区劳动西路289号嘉盛国际1408，0731-82278881，NIA收；</h6>
                                                    <h6>4、寄回时请教衣服封妥，这样更利于提高货物的安全性哟。</h6>
                                                </div>
                                                <!--/提示-->
                                                <!--页尾-->
                                                <div class="row bottom">
                                                    <div class="col-md-4 col-xs-6 col-md-offset-4 col-xs-offset-3 text-center">
                                                        <h4><strong>CHOIZY</strong></h4>
                                                    </div>
                                                </div>
                                                <!--/页尾-->
                                            </div>

                                        </div>

                                        <div class="row">&nbsp;</div>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="ln_solid"></div>
                        <div class="right">
                            <button type="button" class="btn btn-default pull-right btn-print" data-toggle="modal" data-target=".bs-example-modal-lg">盒子清单打印</button>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <!--/盒子清单打印效果预览-->
            <!--搭配指南打印效果预览-->
            <div class="row">
                <div class="col-md-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2>盒子清单打印</h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                </li>
                            </ul>
                            <div class="clearfix"></div>
                        </div>
                        <div class="x_content text-center">
                            <div class="container-fluid">

                                <div class="row">
                                    <div class="col-md-12 col-xs-12" style="border: 2px solid black;">

                                        <div class="row">&nbsp;</div>

                                        <div class="row">

                                            <div class="col-md-10 col-xs-10 col-md-offset-1 col-xs-offset-1">

                                                <!--标题-->
                                                <div class="row">
                                                    <div class="col-md-4 col-xs-6 col-md-offset-4 col-xs-offset-3 text-center">
                                                        <img src="{{asset('images/printlogo.png')}}" class="img-responsive img-thumbnail" alt="" style="border:none;width:35%;">
                                                        <h4><strong>搭配指南</strong></h4>
                                                    </div>
                                                </div>
                                                <!--/标题-->
                                                <!--表格-->
                                                <div class="row">

                                                </div>
                                                <!--/表格-->
                                                <!--页尾-->
                                                <div class="row bottom">
                                                    <div class="col-md-4 col-xs-6 col-md-offset-4 col-xs-offset-3 text-center">
                                                        <h4><strong>CHOIZY</strong></h4>
                                                    </div>
                                                </div>
                                                <!--/页尾-->
                                            </div>

                                        </div>

                                        <div class="row">&nbsp;</div>

                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="clearfix"></div>
                        <div class="ln_solid"></div>
                        <div class="right">
                            <button type="button" class="btn btn-default pull-right btn-print" data-toggle="modal" data-target=".bs-example-modal-lg">盒子清单打印</button>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
            <!--/搭配指南打印效果预览-->
        </div>
    </div>

    <!-- Large modal -->
    <div id="exampleModal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" >
        <div class="modal-dialog modal-lg">
            <div class="modal-content" style="border:none;">
                <div class="row content" style="padding:10px;"></div>
                <div class="row text-center hidden-print">
                    <button type="button" class="btn btn-primary hidden-print">打印</button>
                </div>
            </div>

        </div>
    </div>
    <!-- /Large modal -->
    <!-- /page content -->
@stop

@section('extjs')
    <!--ext js-->

    <!--custem print-->
    <script>
        $('#exampleModal').on('show.bs.modal', function (event) {
            var button = $(event.relatedTarget);
            var html = button.parent().prevAll('.x_content').html();

            var modal = $(this);
            modal.find('.modal-title').text("打印 "+$(this).text())
            modal.find('.modal-content>.row.content').html(html);

            modal.find('.btn.btn-primary.hidden-print').click(function(){
                window.print();
            });
        })
    </script>
    <!--/custem print-->
@stop